import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysTenantPrivilegeRelation = (params) => {
  params.head.transCode = 'querySysTenantPrivilegeRelation';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/querySysTenantPrivilegeRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysTenantPrivilegeRelationListPage = (params) => {
  params.head.transCode = 'querySysTenantPrivilegeRelationListPage';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/querySysTenantPrivilegeRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysTenantPrivilegeRelation = (params) => {
  params.head.transCode = 'saveSysTenantPrivilegeRelation';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/saveSysTenantPrivilegeRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysTenantPrivilegeRelationList = (params) => {
  params.head.transCode = 'saveSysTenantPrivilegeRelationList';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/saveSysTenantPrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysTenantPrivilegeRelation = (params) => {
  params.head.transCode = 'saveOrUpdateSysTenantPrivilegeRelation';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/saveOrUpdateSysTenantPrivilegeRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysTenantPrivilegeRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateSysTenantPrivilegeRelationList';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/saveOrUpdateSysTenantPrivilegeRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysTenantPrivilegeRelation = (params) => {
  params.head.transCode = 'updateSysTenantPrivilegeRelation';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/updateSysTenantPrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysTenantPrivilegeRelation = (params) => {
  params.head.transCode = 'deleteSysTenantPrivilegeRelation';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/deleteSysTenantPrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysTenantPrivilegeRelationList = (params) => {
  params.head.transCode = 'deleteSysTenantPrivilegeRelationList';
  return request({
    url: '/platform/sysTenantPrivilegeRelation/deleteSysTenantPrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysTenantPrivilegeRelationExcel = (params) => {
  params.head.transCode = '';
  downloadExcel({
    url: '/platform/sysTenantPrivilegeRelation/excelDownload/exportSysTenantPrivilegeRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
